package net.jsoft.platform.schedule.config;

import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class ScheduleStartupRunner implements CommandLineRunner
{

    @Override
    public void run(String... args) throws Exception
    {
        System.out.println(">>>>>>>>>>>>>>>服务启动执行，执行启动自动任务操作<<<<<<<<<<<<<");
        SchedulerFactory sf = new StdSchedulerFactory();
        Scheduler sched = sf.getScheduler();
        // 启动调度器  
        sched.start();
    }

}
